# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AccessApproval.V1.Model.SignatureInfo do
  @moduledoc """
  Information about the digital signature of the resource.

  ## Attributes

  *   `customerKmsKeyVersion` (*type:* `String.t`, *default:* `nil`) - The resource name of the customer CryptoKeyVersion used for signing.
  *   `googleKeyAlgorithm` (*type:* `String.t`, *default:* `nil`) - The hashing algorithm used for signature verification. It will only be present in the case of Google managed keys.
  *   `googlePublicKeyPem` (*type:* `String.t`, *default:* `nil`) - The public key for the Google default signing, encoded in PEM format. The signature was created using a private key which may be verified using this public key.
  *   `serializedApprovalRequest` (*type:* `String.t`, *default:* `nil`) - The ApprovalRequest that is serialized without the SignatureInfo message field. This data is used with the hashing algorithm to generate the digital signature, and it can be used for signature verification.
  *   `signature` (*type:* `String.t`, *default:* `nil`) - The digital signature.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :customerKmsKeyVersion => String.t() | nil,
          :googleKeyAlgorithm => String.t() | nil,
          :googlePublicKeyPem => String.t() | nil,
          :serializedApprovalRequest => String.t() | nil,
          :signature => String.t() | nil
        }

  field(:customerKmsKeyVersion)
  field(:googleKeyAlgorithm)
  field(:googlePublicKeyPem)
  field(:serializedApprovalRequest)
  field(:signature)
end

defimpl Poison.Decoder, for: GoogleApi.AccessApproval.V1.Model.SignatureInfo do
  def decode(value, options) do
    GoogleApi.AccessApproval.V1.Model.SignatureInfo.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AccessApproval.V1.Model.SignatureInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
